﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace TraCuuDiemNhom3.QuanTri
{
    public partial class XoaNguoiDung : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        DataTable tblXoa;
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            int a = TienIchSQL.ChayLenhUpdateDuLieu("Delete NguoiDung where UserName = @userName", "@userName", txtUserName.Text);
            if (a > 0)
            {
                lblStatus.Visible = true;
                lblStatus.Text = "Đã xóa thành công " + a.ToString() + " dòng dữ liệu!!!";
            }
        }

        protected void btnView_Click(object sender, EventArgs e)
        {
            tblXoa = TienIchSQL.ChayLenhSelectDuLieu("Select * from nguoidung n where n.UserName=@userName ", "@userName",txtUserName.Text);
            lblGioiTinh.Text = tblXoa.Rows[0]["GioiTinh"].ToString();
            lblHoTen.Text = tblXoa.Rows[0]["HoTen"].ToString();
            lblChucVu.Text = tblXoa.Rows[0]["ChucVu"].ToString();
            lblNgaySinh.Text = tblXoa.Rows[0]["NgaySinh"].ToString();
            lblQuyen.Text = tblXoa.Rows[0]["Quyen"].ToString();

        }

        protected void txtMaSV_TextChanged(object sender, EventArgs e)
        {

        }
    }
}